package com.dingreading.cloud.common.util;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

public class MemberUtil {

    /**
     * 获取年级
     */
    public static String getGrade(Integer grade) {
        if (grade != null) {
            if (grade.equals(-1))
                return "大班";
            else if (grade.equals(-2))
                return "中班";
            else if (grade.equals(-3))
                return "小班";
            else if (grade.equals(1))
                return "一年级";
            else if (grade.equals(2))
                return "二年级";
            else if (grade.equals(3))
                return "三年级";
            else if (grade.equals(4))
                return "四年级";
            else if (grade.equals(5))
                return "五年级";
            else if (grade.equals(6))
                return "六年级";
            else if (grade.equals(7))
                return "初一";
            else if (grade.equals(8))
                return "初二";
            else
                return "未知";
        }
        return "未知";
    }

    /**
     * 获取年级
     */
    public static String getCutomSource(String customSource) {
        if (StringUtils.isNotBlank(customSource)) {
            if (customSource.equals("DT"))
                return "地推";
            else if (customSource.equals("YY"))
                return "异业";
            else if (customSource.equals("ZJ"))
                return "转介绍";
            else if (customSource.equals("ZR"))
                return "自然到访";
            else if (customSource.equals("QT"))
                return "其他";
            else
                return "";
        }
        return "";
    }

}